import pandas
import re
time.sleep(3)
data = pandas.read_csv('D://nanfang/comment.csv',usecols=['comment','url'],keep_default_na=False)
comment = []
dict = {}
dict['comment']=[]
url = data['url']
for i in range(len(data)):
    newscomment = data['comment'][i]

    if newscomment == None:
        comment.append(None)
    else:
        list = newscomment.split(',')
        co = []
        for t in list:
            #pat = '\\\\ud...'
            #str = re.compile(pat).findall(t)
            #print(str)
            highpoints = re.sub('\\\\ud...', '', t)
            unicode = highpoints.encode('utf8').decode('unicode_escape')
            co.append(unicode+'￥')
        dict['comment'].append(co)

dict['url']=url

all_data = pandas.DataFrame(dict)
all_data.to_csv('D:/nanfang/comment_decode.csv', encoding='utf-8-sig')
print(all_data)
'''
            #for r in range(len(list)):
                #list[r] = unicode
                #print(list)
'''
